<?php

    date_default_timezone_set("Europe/Berlin");
    UsingDir(dirname(__FILE__). "/../");
    require_once "config.inc.php";
    require_once "libs/smarty/Smarty.class.php";
    require_once "autoload_classes.php";
    spl_autoload_register( '__autoload' );
    require_once "post_config.inc.php";

    ReturnPrevWorkDir();

    function UsingDir($dir)
    {
        global $DIRECTORY_STACK;
    
        if (!$DIRECTORY_STACK)
        {
            $DIRECTORY_STACK = array();
        }
    
        array_push($DIRECTORY_STACK, getcwd());
        chdir($dir);
    }
    
    function ReturnPrevWorkDir()
    {
        global $DIRECTORY_STACK;
    
        if (!$DIRECTORY_STACK)
        {
            return;
        }
        chdir(array_pop($DIRECTORY_STACK));
    }    
?>
